package com.carrental.service;

import java.util.List;

import com.carrental.dao.CarRentalDao;
import com.carrental.entity.CarRental;

//逻辑操作
public class CarRentalService {
	
	CarRentalDao carRentalDao;
	
	public CarRentalService() throws Exception {
		carRentalDao = new CarRentalDao();
	}
	
	//添加
	public int add(CarRental carRental) throws Exception {
		return carRentalDao.add(carRental);
	}
	
	//查询所有
	public List<CarRental> selectAll() throws Exception {
		return carRentalDao.selectAll();
	}
	
	//根据用户名查询
	public List<CarRental> selectByUsername(String username) throws Exception {
		return carRentalDao.selectByUsername(username);
	}

}
